import functools
import os
train_path = '/home/nvidia/FastestDet/fruits_0/images/train/'
val_path = '/home/nvidia/FastestDet/fruits_0/images/val/'
train_list = os.listdir(train_path)
val_list = os.listdir(val_path)
f_train = open('./dataset/train.txt', 'a')
f_val = open('./dataset/val.txt', 'a')
for train in train_list:
    train_img = train_path.replace('fruits_0/images/train', 'dataset/train') + str(train)

    f_train.write(train_img+'\n')


for val in val_list:
    val_img = val_path.replace('fruits_0/images/val', 'dataset/val') + str(val)
    f_val.write(val_img + '\n')